package vmcs.maintenance;

// Copyright 1997 ISS.
// The contents contained in this document may not be reproduced in any
// form or by any means, without the written permission of ISS, other
// than for the purpose for which it has been supplied.
//
// Author: Olivo Miotto
//
//

import java.awt.*;

import vmcs.controller.MaintenanceController;

public class AccessManager {

    private Panel	passwordPanel = null;
    private MaintenanceController   mctrl;
    private Password    pswd;
    private boolean     loginState= false;

    public AccessManager (MaintenanceController  mc) {
      mctrl = mc;
      pswd = new Password();
    }
    public void closeDown () {
    }

    public void processPassword(String ps){
      boolean   psr;

      psr = pswd.validatePassword(ps);
      loginState = psr;
      mctrl.loginMaintainer(psr);
    }

    public boolean getLoginState(){
      return loginState;
    }

    public void logout(){
      loginState = false;
    }
}